package com.treasure.mall.biz.service.core.withdraw;

import com.treasure.mall.biz.base.SearchableCrudService;
import com.treasure.mall.biz.dto.withdraw.UpdateWithdrawStatusDTO;
import com.treasure.mall.biz.dto.withdraw.WithdrawDTO;
import com.treasure.mall.biz.entity.user.UserPO;
import com.treasure.mall.biz.entity.withdraw.WithdrawPO;
import com.treasure.mall.zbq.common.base.ApiResult;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author zoul
 * @version 1.0
 * @date 2020/6/14 15:40
 * @Description
 */
public interface WithdrawService extends SearchableCrudService<WithdrawPO, Long> {

    /**
     * 修改提现申请状态
     *
     * @param dto 修改实体
     */
    @Transactional(rollbackFor = Exception.class)
    void updateWithdrawStatus(UpdateWithdrawStatusDTO dto);

    /**
     * 用户取消提现申请
     *
     * @param userId  用户Id
     * @param applyId 提现Id
     */
    @Transactional(rollbackFor = Exception.class)
    ApiResult cancelWithdrawStatus(Long userId, Long applyId);

    @Transactional(rollbackFor = Exception.class)
    ApiResult applyWithdraw(WithdrawDTO dto, UserPO user);

    void repairOldData();
}
